/*
 This program is submitted as part of an assignment in the
 J2E
 Fall Semester 2010-2011 
 School of Computer Science
 Interdisciplinary Center, Hertzelia, Israel 

 http://www.idc.ac.il 

 Exercise No.         : 3
 File Name            : BaseActivity.java
 Names (First Last)   : Itay Sorani, Nadav Ziv, Yonathan Zarsky
 Student No.          : 066530254, 039937883, 039692918
 */

package com.example.communication;

import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;

import com.example.TaskResult;

/**
 * A strategy for marshaling a MoveResult to an output stream or unmarshaling one from an input stream.
 */
public interface ResultMarshaller {

    /**
     * Writes a given MoveResult on a given output stream in a way that it can be reproduced at the other hand
     * using a call to unmarshal(DataInputStream)
     */
    public void marshal(DataOutputStream output, TaskResult result) throws IOException;

    /**
     * Reads from an input stream a MoveRequest object that was written using the marshal(OutputStream) method
     */
    public TaskResult unmarshal(DataInputStream input) throws IOException;

}
